package org.zhs.springframework.factory.support;

import com.sun.xml.internal.bind.v2.runtime.reflect.opt.Const;
import org.zhs.springframework.BeansException;
import org.zhs.springframework.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * 实例化策略接口
 */
public interface InstantiationStrategy {

    /**
     *
     * @param beanDefinition
     * @param beanName
     * @param ctor
     * @param args
     * @return
     * @throws BeansException
     */
    Object instantiate(BeanDefinition beanDefinition, String beanName,
                       Constructor ctor, Object[] args) throws BeansException;

}
